<template>
  <div class="risk">
    <page-tab-list
      :url="this.$constUrl.ZXTF_AchievementsTaskDts_GetPageData"
      :params="params"
      @initList="_initList"
    >
      <van-cell class="card" v-for="(dataItem, index) in list" :key="index">
        <div @click="goDetail(dataItem)">
          <van-row>
            <van-col span="24"
              ><div class="title">
                任务名称：{{ dataItem.TaskName }}
              </div></van-col
            >
          </van-row>
          <van-row>
            <van-col span="12">总分：{{ dataItem.TotalScore }}</van-col>
            <van-col span="12">合格分数：{{ dataItem.StandardScore }}</van-col>
          </van-row>
          <!-- <van-row v-show="dataItem.PublishDate==null">
                  <van-col span="24">
                    <span>自评人员：{{dataItem.ReceiverName}}</span>
                  </van-col>
                </van-row> -->
          <!-- <van-row v-show="dataItem.PublishDate!=null">
                  <van-col span="12"> <span>自评人员：{{dataItem.ReceiverName}}</span> </van-col>
                  
                </van-row> -->
          <van-row v-show="dataItem.PublishDate != null">
            <van-col span="12">
              自评得分：<span
                v-if="dataItem.SelfScore >= dataItem.StandardScore"
                class="c-green"
                >{{ dataItem.SelfScore }}</span
              >
              <span
                v-if="dataItem.SelfScore < dataItem.StandardScore"
                class="c-red"
                >{{ dataItem.SelfScore }}</span
              >
            </van-col>
            <van-col span="12">
              考评最终得分：
              <span v-if="!dataItem.OverallScore">{{
                "未出"
              }}</span>
              <span
                v-if="dataItem.OverallScore >= dataItem.StandardScore"
                class="c-green"
                >{{ dataItem.OverallScore }}</span
              >
              <span
                v-if="dataItem.OverallScore < dataItem.StandardScore"
                class="c-red"
                >{{ dataItem.OverallScore }}</span
              >
            </van-col>
          </van-row>
          <van-row>
            <van-col span="24">
              考评人：{{ dataItem.OtherTaskUserOrgName }}
            </van-col>
          </van-row>
          <van-row>
            <van-col span="12">发起人：{{ dataItem.CreateChnName }}</van-col>
            <van-col span="12"
              >创建时间：{{ dataItem.CreateDate | formatDate }}</van-col
            >
          </van-row>
          <van-row>
            <van-col span="12"
              >开始时间：{{ dataItem.StartDate | formatDate }}</van-col
            >
            <van-col span="12"
              >结束时间：{{ dataItem.EndDate | formatDate }}</van-col
            >
          </van-row>
        </div>
        <van-row v-show="dataItem.PublishDate == null">
          <van-col span="24">
            <div class="dep_btm">
              <div class="btm_item" @click="goUpdate(dataItem)">
                <van-icon name="notes-o" size="18" />
                <div class="mr-10">自评</div>
              </div>
            </div>
          </van-col>
        </van-row>
      </van-cell>
    </page-tab-list>
  </div>
</template>
     
<script>
import PageTabList from "@/components/PageTabList/PageTabList.vue";

export default {
  components: { PageTabList },
  data() {
    return {
      list: [],
      params: [
        {
          title: "待自评",
          dataType: "SelfList",
          dtsStatus: "0",
        },
        {
          title: "已自评",
          dataType: "SelfList",
          dtsStatus: "10",
        },
      ],
    };
  },
  methods: {
    _initList(list) {
      this.list = list;
    },
    goDetail(item) {
      if (item.PublishDate == null) {
        return;
      }
      this.$router.push({
        path: "/SelfView",
        query: { ID: item.ID },
      });
    },
    goUpdate(item) {
      this.$router.push({
        path: "/SelfDetail",
        query: { ID: item.ID },
      });
    },
  },
};
</script>
<style lang="less" scoped>
.card {
  .title {
    font-weight: bold;
  }
}

.dep_btm {
  display: flex;
  justify-content: flex-end;
  line-height: 27px;
  .btm_item {
    display: flex;
    align-items: center;
    img {
      height: 15px;
      width: 15px;
      margin-right: 5px;
    }
  }
}
</style>